import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_syt/datas/message_model.dart';
import 'package:flutter_syt/theme/theme_color.dart';
import 'package:flutter_syt/utils/web_socket_utility.dart';

class ServiceMessagesText extends StatelessWidget {
  final MessageModel model;
  ServiceMessagesText({required this.model});
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(vertical: 16, horizontal: 12),
      constraints: BoxConstraints(maxWidth: 280.w),
      decoration: BoxDecoration(
          color: model.direction == MessageDirection.RECEIVE
              ? Color(0xffF4F4F4)
              : ThemeColor.primaryColor,
          borderRadius: model.direction == MessageDirection.RECEIVE
              ? BorderRadius.only(
                  bottomLeft: Radius.circular(12),
                  bottomRight: Radius.circular(12),
                  topRight: Radius.circular(12))
              : BorderRadius.only(
                  bottomLeft: Radius.circular(12),
                  bottomRight: Radius.circular(12),
                  topLeft: Radius.circular(12))),
      child: Text(
        model.content ?? '',
        // (model.createTime ?? 0).toString(),
        style: TextStyle(fontSize: 14),
      ),
    );
  }
}
